<?php
namespace Swiftx\Component\Orm;
use Swiftx\Interfaces\Orm\Entity as EntityInterface;
/**
 * 对象实体接口
 *
 * @author		Hismer <odaytudio@gmail.com>
 * @since		2014-12-16
 * @copyright	Copyright (c) 2014-2015 Swiftx Inc.
 */
abstract class Entity implements EntityInterface{

    /**
     * 是否持久化
     * @var bool
     */
    protected $linked = false;

    /**
     * 查看是否持久化
     * @return bool
     */
    public function isLinked():bool {
        return $this->linked;
    }

    /**
     * 设置是否持久化
     * @param bool $state
     */
    public function setLinked(bool $state){
        $this->linked = $state;
    }

    /**
     * UUID生成器
     */
    protected function generateUUID(){
        return trim(file_get_contents('/proc/sys/kernel/random/uuid'));
    }

}